Skip to content

feat(harness): plugin skeleton — plugin.json + ${CLAUDE_PLUGIN_ROOT} script refs (closes #36) - #43

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-36-plugin-skeleton
Jul 3, 2026
Merged

feat(harness): plugin skeleton — plugin.json + ${CLAUDE_PLUGIN_ROOT} script refs (closes #36)#43
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-36-plugin-skeleton

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Packaging phase 1: plugin skeleton (closes #36)

Packages this orchestration harness as a Claude Code plugin, additively — the in-repo .claude/ self-hosting flow that this repo's own live PR loop runs on stays fully intact.

What changed (all under .claude/**)

  • Plugin manifest.claude/.claude-plugin/plugin.json (name orchestrator, v0.1.0). Placing the manifest at .claude/.claude-plugin/ makes the plugin root .claude/, so commands/, agents/, hooks/hooks.json, and scripts/ auto-discover from the existing tree — no files relocated.
  • Command namespacing — comes for free from the plugin name orchestrator: installed, commands invoke as /orchestrator:pr-loop etc.; in-repo they stay project-level /pr-loop. No command files renamed, so in-repo invocations are unchanged.
  • Plugin hooks.claude/hooks/hooks.json mirrors the settings.json lint/test hooks using ${CLAUDE_PLUGIN_ROOT}. Inert in-repo (plugin hooks activate only when the plugin is installed), so it never double-fires the repo's settings.json hooks.
  • Script-ref migration — every bash .claude/scripts/… invocation in agent/command prompts → bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/… (15 invocations across implementer.md, test-runner.md, pr-loop.md, pr-loop-self.md, setup-orchestrator.md, test-pr.md).
  • Gate coverage.claude/self/checks.sh do_build now JSON-validates both new artifacts (plugin.json, hooks.json) in its parse loop; correctly excluded from the adapter-shape check.

Backward-compatible migration (in-repo self-hosting preserved)

The fallback ${CLAUDE_PLUGIN_ROOT:-.claude} is the crux: when the var is unset (in-repo dogfooding) it expands to .claude, giving byte-identical .claude/scripts/… resolution — so the live loop is unchanged; when the plugin is installed it resolves from the install path. The loop-critical scripts (notify-poll, merge-ready, pr-feedback, gate, bot-gh, worktree, prepare-pr) are not moved/renamed; .claude/settings.json hooks are untouched and still call them by literal path. Config paths (.claude/gates.json, GATES_FILE=.claude/self/gates.json) stay project-relative (adapter lives in the consuming project, not the plugin root).

Out of scope (later phases)

.claude/workflows/*.js (not plugin-distributable) and .claude/self/* stay repo-scaffolded; setup/sync skills (phases 2–3) and marketplace+docs (phase 4) are not included.

Verification

  • Self gates (SELF adapter) all green: build exit 0, lint exit 0, test exit 0.
  • Reviewers: correctness APPROVE (in-repo self-hosting flow verified intact — scripts at literal paths, hooks unbroken, fallback resolves identically when unset), tests APPROVE (all gates green, both new artifacts provably gate-covered).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY

…script refs (#36)

Add .claude/.claude-plugin/plugin.json (plugin name "orchestrator", so commands
auto-namespace as /orchestrator:* when installed) and .claude/hooks/hooks.json
mirroring the lint/test_affected hooks from settings.json, referencing scripts
via ${CLAUDE_PLUGIN_ROOT}. Migrate every `bash .claude/scripts/<name>.sh`
invocation in agents/*.md and commands/*.md to
`bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/<name>.sh` so downstream plugin
installs resolve scripts correctly while the in-repo fallback keeps the live
self-hosting loop byte-identical. Extend the self build gate to JSON-validate
the two new artifacts. Add a short plugin README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
@robercano-ghbot
robercano-ghbot merged commit 1b1571b into main Jul 3, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-36-plugin-skeleton branch July 3, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packaging phase 1: plugin skeleton — ship agents/commands/skills/hooks/scripts as a Claude Code plugin

2 participants